package cn.bonoon.entities.interacting;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import cn.bonoon.kernel.support.entities.AbstractPersistable;

/**
 * 接收到的消息实体
 * 
 * @author jackson
 * 
 */
@Entity
@Table(name = "t_messageaccept")
public class MessageAcceptEntity extends AbstractPersistable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 7856498444564855358L;
	@ManyToOne
	@JoinColumn(name = "R_MESSAGE_ID")
	private MessageEntity message;
	
	@Column(name = "C_HASREAD")
	private boolean hasRead;
	
	@Column(name = "C_ACCEPTERID")
	private Long accepterId;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "C_READAT")
	private Date readAt;

	public MessageEntity getMessage() {
		return message;
	}

	public void setMessage(MessageEntity message) {
		this.message = message;
	}

	public boolean isHasRead() {
		return hasRead;
	}

	public void setHasRead(boolean hasRead) {
		this.hasRead = hasRead;
	}

	public Long getAccepterId() {
		return accepterId;
	}

	public void setAccepterId(Long accepterId) {
		this.accepterId = accepterId;
	}

	public Date getReadAt() {
		return readAt;
	}

	public void setReadAt(Date readAt) {
		this.readAt = readAt;
	}
}
